
<div id="sidenav">
  <div class="sidenav_h"> <a href="/catalog/seo_sitemap/category/" id="sitemap">Shop All Categories</a> </div>
  <div  id="sitemap_menu" class="sidebar_menu hide">
    
   			<?php foreach ($this->getStoreCategories() as $_category): ?>
          <?php echo $this->drawItem($_category) ?>
          <?php endforeach ?>
      
      </div>
</div>
<script type="text/javascript">
var litem_width=$('sidenav').getWidth()-2;
$$("div.litem").each (function (s){
	s.setStyle({width:litem_width+"px"});
});
$$("div.litem").invoke("observe", "mouseover", function() {
var offset = this.cumulativeOffset();
var sidenav=$('sidenav').cumulativeOffset();
var sidenav_width=$('sidenav').getWidth()-2;
var offsetTop = offset[1];
var height= this.down('div.subitem').getHeight();
var sidenav_h =sidenav[1];
if ((offsetTop-sidenav_h)>height)
{
	
	offsetTop=(offsetTop-sidenav_h-(height/2));
	this.down('div.subitem').setStyle({top:offsetTop+"px"});
}

this.addClassName('hoverClass');this.down('div.subitem').setStyle({display:'block',left:sidenav_width+"px"}) });
$$("div.litem").invoke("observe", "mouseout", function() {
this.removeClassName('hoverClass');this.down('div.subitem').setStyle({display:'none'}) });
</script>
